@extends('layouts.app')
@section('content')
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                @include('admin.left')
            </div>
            <div class="col-sm-10">
                <ol class="breadcrumb">
                    <li><a href="#">Home</a></li>
                    <li><a href="#">Library</a></li>
                    <li class="active">Data</li>
                </ol>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        文章管理
                    </div>
                    <div class="panel-body">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th><i class="glyphicon glyphicon-eye-open"></i> 标题</th>
                                <th>分类</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($articles as $article)
                                <tr>
                                    <td>{{ $article->id }}</td>
                                    <td><a href="#">{{ $article->title }}</a></td>
                                    <td>{{ $article->category->name }}</td>
                                    <td>
                                        <a href="{{ route('admin.articles.edit', [$article->id]) }}"><i class="glyphicon glyphicon-edit"></i></a>
                                        <a href="{{ route('admin.articles.destroy', [$article->id]) }}"><i class="glyphicon glyphicon-trash"></i></a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection